using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.VisualBasic;
using System.Collections;
using System.Diagnostics;

using System;


public partial class ReplaceDialog
{

    public string Res = "Cancel";

    public ReplaceDialog()
    {
        InitializeComponent();
    }
    public void ReplaceDialog_Loaded(object sender, RoutedEventArgs e)
    {
        if (MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnVista || MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnWin7)
        {
            AppHelper.ExtendGlassFrame(this, new Thickness(-1, -1, -1, -1));
        }
        TextBox1.Focus();
    }

    public void OKButton_Click(object sender, RoutedEventArgs e)
    {
        Res = "OK";
        Close();
    }

    public void TextBox_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.Key == Key.Enter)
        {
            if (OKButton.IsEnabled)
            {
                OKButton_Click(null, null);
            }
        }
    }

    public void TextBox_TextChanged(object sender, TextChangedEventArgs e)
    {
        if (TextBox1.Text.Length > 0 && TextBox2.Text.Length > 0)
        {
            OKButton.IsEnabled = true;
        }
        else
        {
            OKButton.IsEnabled = false;
        }
    }
}

